<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    table {
        width: 500px;
        background-color: #ccc;
        border: 1px solid #000;
        margin: 100px auto;
        border-collapse: collapse;
    }

    thead tr td {
        border: 1px solid #000;
        text-align: center;
        height: 40px;
    }

    tbody tr td {
        border: 1px solid #000;
        text-align: center;
        height: 40px;
    }
</style>

<body>
    <table>
        <thead>
            <tr>
                <td>姓名</td>
                <td>科目</td>
                <td>成绩</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>

        </tbody>
    </table>
</body>

</html>
<script>
    var date = [
        {
            姓名: '魏璎珞',
            科目: 'javaScript',
            成绩: '100'
        },
        {
            姓名: '弘历',
            科目: 'javaScript',
            成绩: '90'
        },
        {
            姓名: '傅恒',
            科目: 'javaScript',
            成绩: '99'
        },
        {
            姓名: '明玉',
            科目: 'javaScript',
            成绩: '89'
        },
    ]

    var tbody = document.querySelector('tbody');

    for (var i = 0; i < date.length; i++) {

        var tr = document.createElement('tr');

        tbody.appendChild(tr);

        for (var k in date[i]) {
            var td = document.createElement('td')
            td.innerHTML = date[i][k];
            tr.appendChild(td)
        }

        var td = document.createElement('td')
        td.innerHTML = '<a href="javascript:;">删除</a>'
        tr.appendChild(td)

    }
    var all = document.querySelectorAll('a');
    for (var i = 0; i < all.length; i++) {
        all[i].addEventListener('click', function () { })
        all[i].onclick = function () {
            tbody.removeChild(this.parentNode.parentNode)
        }
    }

</script>